package example;

abstract class Person {
	private String name;
	private String sex;

	public Person() {
		this("None", "Male");
	}

	public Person(String name, String sex) {
		super();
		this.name = name;
		this.sex = sex;
	}

	public String getName() {
		return name;
	}

	public String getSex() {
		return sex;
	}

	public abstract void showMessage();
}

interface Score {
	public int getScore();
}

interface Salary {
	public int getSalary();
}

class Student extends Person implements Score {
	private int score;

	public Student() {
		this("None", "Male", 0);
	}

	public Student(String name, String sex, int score) {
		super(name, sex);
		this.score = score;
	}

	public int getScore() {
		return score;
	}

	public void showMessage() {
		System.out.println("Name:\t" + getName() + "\nSex:\t" + getSex()
				+ "\nScore:\t" + getScore());
	}
}

class Employee extends Person implements Salary {
	private int salary;

	public Employee() {
		this("None", "Male", 0);
	}

	public Employee(String name, String sex, int salary) {
		super(name, sex);
		this.salary = salary;
	}

	public int getSalary() {
		return salary;
	}

	public void showMessage() {
		System.out.println("Name:\t" + getName() + "\nSex:\t" + getSex()
				+ "\nSalary:\t" + getSalary());
	}
}

class Employer extends Employee {
	int day;
	double saperday;

	public Employer() {
		this("None", "Male", 0, 0, 0);
	}

	public Employer(String name, String sex, int salary, int day,
			double saperday) {
		super(name, sex, salary);
		this.day = day;
		this.saperday = saperday;
	}

	public int getSalary() {
		return (int) (super.getSalary() + day * saperday);
	}
}

class Manager extends Employee {
	int externalSalary;

	public Manager() {
		this("None", "Male", 0, 0);
	}

	public Manager(String name, String sex, int salary, int externalSalary) {
		super(name, sex, salary);
		this.externalSalary = externalSalary;
	}

	public int getSalary() {
		return super.getSalary() + externalSalary;
	}
}

public class Demo11 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Manager a = new Manager("", "", 3000, 4000);
		a.showMessage();
	}
}
